package cn.stylefeng.guns.modular.storage.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.storage.entity.StorageOut;
import cn.stylefeng.guns.modular.storage.model.params.StorageOutParam;
import cn.stylefeng.guns.modular.storage.model.result.StorageOutResult;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 拣货单表 服务类
 * </p>
 *
 * @author hu
 * @since 2019-07-11
 */
public interface StorageOutService extends IService<StorageOut> {

    /**
     * 新增
     *
     * @author hu
     * @Date 2019-07-11
     */
    void add(StorageOutParam param);

    /**
     * 删除
     *
     * @author hu
     * @Date 2019-07-11
     */
    void delete(StorageOutParam param);

    /**
     * 更新
     *
     * @author hu
     * @Date 2019-07-11
     */
    void update(StorageOutParam param);

    /**
     * 查询单条数据，Specification模式
     *
     * @author hu
     * @Date 2019-07-11
     */
    StorageOutResult findBySpec(StorageOutParam param);

    /**
     * 查询列表，Specification模式
     *
     * @author hu
     * @Date 2019-07-11
     */
    List<StorageOutResult> findListBySpec(StorageOutParam param,Long deptId);

    /**
     * 查询分页数据，Specification模式
     *
     * @author hu
     * @Date 2019-07-11
     */
     LayuiPageInfo findPageBySpec(StorageOutParam param, String condition,Long deptId,Long operateId);
     
     List<StorageOutResult> findPageBySpecNew(StorageOutParam param, String condition,Long deptId);

    /**
     * 查询分页数据，Specification模式
     *
     * @author wz
     * @Date 2019-07-11
     */
    LayuiPageInfo findPageBySpecWork(StorageOutParam param, String condition,Long deptId);

    /**
     * 查询最后一条数据
     * @return
     */
    StorageOut findLastOne();

    /**
     * 查询分页数据，Specification模式
     *	根据 收货单位.地址
     * @author hu
     * @Date 2019-07-11
     */
	LayuiPageInfo findPageByGet(StorageOutParam storageOutParam, String condition, Long deptId);

    /**
     * app通过地址id 收货单位id 查询订单列表
     * @param storageOutParam
     * @param deptId
     * @return
     * @author wz
     */
    List<StorageOutResult> findPageByGetApp(StorageOutParam storageOutParam, Long deptId);


    /**
     * app出库审核通过地址id 收货单位id 查询订单列表
     * @param storageOutParam
     * @param deptId
     * @return
     * @author wz
     */
    List<StorageOutResult> findPageByGetReview(StorageOutParam storageOutParam, Long deptId);

    /**
     * app工人通过地址id 收货单位id 查询订单列表
     * @param storageOutParam
     * @param deptId
     * @return
     * @author wz
     */
    List<StorageOutResult> findPageByGetAppWork(StorageOutParam storageOutParam, Long deptId,Long operateId);

    /**
     * 审核查询地址信息。
     *
     * @author wz
     * @Date 2019-08-08
     */
    LayuiPageInfo findPageBySpecReview(StorageOutParam param,Long deptId);

    /**
     * 拣货单查询
     * @param storageOutParam
     * @param condition
     * @param deptId
     * @return
     */
	LayuiPageInfo querylistPageBySpec(StorageOutParam storageOutParam, String condition, Long deptId,Long outCustomerId,String singleOutTime
			,Long operateId);
	
	/**
     * 拣货单打印 
     * 查询拣货单信息
     * @author zhucx
     * @Date 2019-09-7
     */
	StorageOutResult getPrintstorageOut(StorageOutParam storageOutParam);

	StorageOutResult findBySpecs(StorageOutParam storageOutParam);

	List<StorageOutResult> findListByMakeSpec(StorageOutParam outParam);

	List<StorageOutResult> findPageBySpecWorkNew(StorageOutParam storageOutParam, String condition, Long deptId,Long operateId);

	List<StorageOutResult> findPageByGetApp2(StorageOutParam sop, Long deptId);

	List<StorageOutResult> findPageBySpecWorkNewexamin(StorageOutParam storageOutParam, String condition, Long deptId,Long operateId);

	List<StorageOutResult> findPageByGetAppWorkexamin(StorageOutParam p, Long deptId,Long operateId);

	List<StorageOutResult> findListByStrs(StorageOutParam param, String[] strs);


    StorageOutResult findByUserAndStorageOutNumber(Long userId, String storageOutNumber);

    void updateUserByStorageOutNumber(Long userId, String name, Date date, String storageOutNumber);
}
